from django.conf.urls import patterns, include, url
from django.views.generic.base import TemplateView
from portal.views import *
from cmdbinfo.views import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'superoper.views.home', name='home'),
    # url(r'^superoper/', include('superoper.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    (r'^$', main_page),

    # Login / logout.
    (r'^login/$', 'django.contrib.auth.views.login'),
    (r'^logout/$', logout_page),

    # Web portal.
    (r'^portal/', include('portal.urls')),

    # Serve static content.
    (r'^static/(?P<path>.*)$', 'django.views.static.serve',
         {'document_root': 'static'}),
    #Registration Page
    (r'^register/$', register_page),

    #Registration Success
    (r'^register/success/$', TemplateView.as_view(template_name='registration/reg_succ.html')),

    #CMDB info
    (r'^cmdb_info/$', cmdb_list_page_server_side),
    url(r'^get_cmdb_list/$', get_cmdb_list, name='get_cmdb_list'),

    #Test Jquery
    (r'hello/$', 'django.views.generic.simple.direct_to_template', {'template':'portal/hello.html'}),
)
